<template>
  <div class="app-container">

    <el-tabs v-model="activeName" v-loading="loading" v-if="showCard">
      <el-tab-pane label="采购入库单" name="first">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
          label-width="68px">
          <el-form-item label="入库日期">
            <el-date-picker type="daterange" v-model="queryParams.date" range-separator="至" start-placeholder="开始日期"
              end-placeholder="结束日期" clearable style="width: 240px" />
          </el-form-item>
          <el-form-item label="仓库员">
            <el-input v-model="queryParams.staff" placeholder="请输入仓库员"></el-input>
          </el-form-item>
          <el-form-item label="入库人">
            <el-input v-model="queryParams.operator" placeholder="请输入入库人"></el-input>
          </el-form-item>
          <el-form-item label="供货商">
            <el-input v-model="queryParams.supplier" placeholder="请输入供货商"></el-input>
          </el-form-item>
          <el-form-item label="入库仓库">
            <el-select v-model="queryParams.warehouse" placeholder="请选择入库仓库">
              <el-option label="全部" value=""></el-option>
              <el-option label="仓库1" value="1"></el-option>
              <el-option label="仓库2" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="对应单号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入对应单号"></el-input>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="queryParams.remark" placeholder="请输入备注"></el-input>
          </el-form-item>
          <el-form-item label="产品代号">
            <el-input v-model="queryParams.productCode" placeholder="请输入产品代号"></el-input>
          </el-form-item>
          <el-form-item label="产品名称">
            <el-input v-model="queryParams.productName" placeholder="请输入产品名称"></el-input>
          </el-form-item>
          <el-form-item label="产品规格">
            <el-input v-model="queryParams.productSpec" placeholder="请输入产品规格"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>
        <el-tooltip placement="top">
          <div slot="content">点击任意一行列即可查看详细入库信息</div>
          <el-table :data="purchaseList" @row-click="handleRowClick">
            <el-table-column align="center" label="入库日期" prop="date" />
            <el-table-column align="center" label="仓库员" prop="staff" />
            <el-table-column align="center" label="入库人" prop="operator" />
            <el-table-column align="center" label="供货商" prop="supplier" />
            <el-table-column align="center" label="入库仓库" prop="warehouse" />
            <el-table-column align="center" label="对应单号" prop="orderNo" />
            <el-table-column align="center" label="备注" prop="remark" />
            <el-table-column align="center" label="产品代号" prop="productCode" />
            <el-table-column align="center" label="产品名称" prop="productName" />
            <el-table-column align="center" label="产品规格" prop="productSpec" />
          </el-table>
        </el-tooltip>

        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />

        <div v-if="showCard">
          <h2 align="center">{{ }}采购入库单</h2>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPurchase">新增</el-button>
            </el-col>
            <el-col el-col :span="1.5">
              <el-button type="warning" plain icon="el-icon-download" size="mini"
                @click="handleExportPurchase">导出</el-button>
            </el-col>
          </el-row>
          <el-table :data="PurchaseDate">
            <el-table-column align="center" label="物料描述">
              <el-table-column prop="code" align="center" label="代号" />
              <el-table-column prop="name" align="center" label="名称" />
              <el-table-column prop="spec" align="center" label="规格" />
              <el-table-column prop="floatingRatio" align="center" label="浮动比例%" />
              <el-table-column prop="type" align="center" label="类型" />
              <el-table-column prop="cotegoryName" align="center" label="类别名称" />
              <el-table-column prop="barcode" align="center" label="条形码" />
              <el-table-column prop="conversionRate" align="center" label="转化率" />
            </el-table-column>
            <el-table-column prop="color" align="center" label="颜色" />
            <el-table-column prop="attribute" align="center" label="属性" />
            <el-table-column prop="contractNo" align="center" label="合同号" />
            <el-table-column prop="batchNo" align="center" label="批号" />
            <el-table-column prop="storageLocation" align="center" label="货位" />
            <el-table-column prop="warehouse" align="center" label="仓库" />
            <el-table-column prop="currentInventory" align="center" label="当前库存" />
            <el-table-column label="操作" align="center" fixed="right">
              <template slot-scope="scope">
                <el-button type="text" size="mini" @click="handleUpdatePurchase(scope.row)">修改</el-button>
                <el-button type="text" size="mini" @click="handleDeletePurchase(scope.row)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
            :total="total" />
        </div>


        <!-- <el-form :model="form" ref="form" style="margin-top: 20px;" label-width="80px">
          <el-row :gutter="20">
            <el-col :span="5">
              <el-form-item label="制单人">
                <el-input v-model="form.staff" placeholder="请输入制单人"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="记账日期">
                <el-date-picker v-model="form.date" style="width: 150px;" type="date"
                  placeholder="选择日期"></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="记账人">
                <el-input v-model="form.accountant" placeholder="请输入记账人"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="修改日期">
                <el-date-picker v-model="form.modifyDate" style="width: 150px;" type="date"
                  placeholder="选择日期"></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="修改人">
                <el-input v-model="form.modifier" placeholder="请输入修改人"></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="5">
              <el-form-item label="制单日期">
                <el-date-picker v-model="form.createDate" style="width: 150px;" type="date"
                  placeholder="选择日期"></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="审核日期">
                <el-date-picker v-model="form.auditDate" style="width: 150px;" type="date"
                  placeholder="选择日期"></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="审核人">
                <el-input v-model="form.auditor" placeholder="请输入审核人"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item label="审核信息">
                <el-input v-model="form.auditInfo" placeholder="请输入审核信息"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="审核级别">
                <el-select v-model="form.auditLevel" placeholder="请选择审核级别">
                  <el-option label="A" value="1"></el-option>
                  <el-option label="B" value="2"></el-option>
                  <el-option label="C" value="3"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>









        </el-form> -->

      </el-tab-pane>

      <el-tab-pane label="生产退料单" name="second">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
          label-width="68px">
          <el-form-item label="退料日期">
            <el-date-picker type="daterange" v-model="queryParams.date" range-separator="至" start-placeholder="开始日期"
          end-placeholder="结束日期" clearable style="width: 240px" />
          </el-form-item>
          <el-form-item label="仓库员">
            <el-input v-model="queryParams.staff" placeholder="请输入仓库员"></el-input>
          </el-form-item>
          <el-form-item label="退料人">
            <el-input v-model="queryParams.operator" placeholder="请输入入库人"></el-input>
          </el-form-item>
          <el-form-item label="币种">
            <el-select v-model="queryParams.currency" placeholder="请选择币种">
              <el-option label="人民币" value="1"></el-option>
              <el-option label="美元" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="退料仓库">
            <el-select v-model="queryParams.warehouse" placeholder="请选择入库仓库">
              <el-option label="全部" value=""></el-option>
              <el-option label="仓库1" value="1"></el-option>
              <el-option label="仓库2" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="对应单号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入对应单号"></el-input>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="queryParams.remark" placeholder="请输入备注"></el-input>
          </el-form-item>
          <el-form-item label="汇率">
            <el-input v-model="queryParams.productCode" placeholder="请输入产品代号"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>
        <el-tooltip placement="top">
          <div slot="content">点击任意一行列即可查看详细入库信息</div>
          <el-table :data="purchaseList" @row-click="handleRowClick">
            <el-table-column align="center" label="退料日期" prop="date" />
            <el-table-column align="center" label="仓库员" prop="staff" />
            <el-table-column align="center" label="退料人" prop="operator" />
            <el-table-column align="center" label="币种" prop="currency" />
            <el-table-column align="center" label="退料仓库" prop="warehouse" />
            <el-table-column align="center" label="对应单号" prop="orderNo" />
            <el-table-column align="center" label="备注" prop="remark" />
            <el-table-column align="center" label="汇率" prop="productCode" />
          </el-table>
        </el-tooltip>

        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />

        <div v-if="showCard">
          <h2 align="center">{{ }}生产退料单</h2>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini"
                @click="handleAddProduction">新增</el-button>
            </el-col>
          </el-row>

          <el-table :data="ProductionDate">
            <el-table-column align="center" label="物料描述">
              <el-table-column prop="code" align="center" label="代号" />
              <el-table-column prop="name" align="center" label="名称" />
              <el-table-column prop="spec" align="center" label="规格" />
              <el-table-column prop="conversionRate" align="center" label="转化率" />
            </el-table-column>
            <el-table-column prop="color" align="center" label="颜色" />
            <el-table-column prop="attribute" align="center" label="属性" />
            <el-table-column prop="contractNo" align="center" label="合同号" />
            <el-table-column prop="batchNo" align="center" label="批号" />
            <el-table-column prop="warehouse" align="center" label="仓库" />
            <el-table-column prop="currentInventory" align="center" label="当前库存" />
            <el-table-column align="center" label="主单位">
              <el-table-column prop="unit" align="center" label="单位" />
              <el-table-column prop="goodProduct" align="center" label="良品" />
              <el-table-column prop="unitPrice" align="center" label="单价" />
              <el-table-column prop="taxPrice" align="center" label="含税价" />
              <el-table-column prop="amount" align="center" label="金额" />
            </el-table-column>
            <el-table-column prop="badProduct" align="center" label="不良品" />
            <el-table-column align="center" label="副单位">
              <el-table-column prop="unit1" align="center" label="单位" />
              <el-table-column prop="number" align="center" label="数量" />
              <el-table-column prop="price1" align="center" label="单价" />
              <el-table-column prop="amount1" align="center" label="金额" />
            </el-table-column>
            <el-table-column prop="taxRate" align="center" label="税率%" />
            <el-table-column prop="taxAmount1" align="center" label="税额" />
            <el-table-column prop="totalAmount" align="center" label="价税合计" />
            <el-table-column prop="currency" align="center" label="附加单据号" />
            <el-table-column align="center" label="操作" fixed="right">
              <template slot-scope="scope">
                <el-button type="text" size="mini" @click="handleDeleteProduction(scope.row)">删除</el-button>
                <el-button type="text" size="mini" @click="handleUpdateProduction(scope.row)">修改</el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
            :total="total" />
        </div>

      </el-tab-pane>

      <el-tab-pane label="半成品入库单" name="third">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
          label-width="68px">
          <el-form-item label="入库日期">
            <el-date-picker type="daterange" v-model="queryParams.date" range-separator="至" start-placeholder="开始日期"
          end-placeholder="结束日期" clearable style="width: 240px" />
          </el-form-item>
          <el-form-item label="入库人">
            <el-input v-model="queryParams.operator" placeholder="请输入入库人"></el-input>
          </el-form-item>
          <el-form-item label="仓库员">
            <el-input v-model="queryParams.staff" placeholder="请输入仓库员"></el-input>
          </el-form-item>
          <el-form-item label="币种">
            <el-select v-model="queryParams.currency" @change="hand" placeholder="请选择币种">
              <el-option label="人民币" value="1"></el-option>
              <el-option label="美元" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="汇率">
            <el-input v-model="queryParams.rate" placeholder="请输入产品代号"></el-input>
          </el-form-item>
          <el-form-item>
            <el-radio v-model="queryParams.radio" label="1">是否超单</el-radio>
            <el-radio v-model="queryParams.radio" label="2">是否已超单</el-radio>
          </el-form-item>
          <el-form-item label="部门">
            <el-select v-model="queryParams.department" placeholder="请选择部门"></el-select>
          </el-form-item>
          <el-form-item label="入库仓库">
            <el-select v-model="queryParams.warehouse" placeholder="请选择入库仓库">
              <el-option label="全部" value=""></el-option>
              <el-option label="仓库1" value="1"></el-option>
              <el-option label="仓库2" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="对应单号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入对应单号"></el-input>
          </el-form-item>
          <el-form-item label="等级">
            <el-select v-model="queryParams.level" placeholder="请选择等级">
              <el-option label="全部" value=""></el-option>
              <el-option label="A" value="1"></el-option>
              <el-option label="B" value="2"></el-option>
              <el-option label="C" value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="queryParams.remark" placeholder="请输入备注"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>

        <el-tooltip placement="top">
          <div slot="content">点击任意一行列即可查看详细入库信息</div>
          <el-table :data="purchaseList" @row-click="handleRowClick">
            <el-table-column align="center" label="入库日期" prop="date" />
            <el-table-column align="center" label="入库人" prop="operator" />
            <el-table-column align="center" label="仓库员" prop="staff" />
            <el-table-column align="center" label="币种" prop="currency" />
            <el-table-column align="center" label="汇率" prop="rate" />
            <el-table-column align="center" label="是否超单" prop="radio" />
            <el-table-column align="center" label="部门" prop="department" />
            <el-table-column align="center" label="入库仓库" prop="warehouse" />
            <el-table-column align="center" label="对应单号" prop="orderNo" />
            <el-table-column align="center" label="备注" prop="remark" />
          </el-table>
        </el-tooltip>
        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />

        <div v-if="showCard">
          <h2 align="center">{{ }}半成品入库单</h2>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddHalfOfPi">新增</el-button>
            </el-col>
          </el-row>

          <el-table :data="PurchaseDate">
            <el-table-column prop="warehouse" align="center" label="仓库" />
            <el-table-column prop="contractNo" align="center" label="合同号" />
            <el-table-column align="center" label="产品描述">
              <el-table-column prop="code" align="center" label="代号" />
              <el-table-column prop="name" align="center" label="名称" />
            </el-table-column>
            <el-table-column prop="color" align="center" label="颜色" />
            <el-table-column prop="referenceQuantity" align="center" label="参照数量" />
            <el-table-column align="center" label="主单位">
              <el-table-column prop="actualQuantity" align="center" label="实际入库数量" />
            </el-table-column>
            <el-table-column align="center" label="员工">
              <el-table-column prop="staff" align="center" label="工号" />
              <el-table-column prop="staffName" align="center" label="姓名" />
            </el-table-column>
            <el-table-column prop="currentSubUnitInventory" align="center" label="当前副单位库存" />
            <el-table-column prop="currentInventory" align="center" label="当前库存" />
            <el-table-column align="center" label="副单位">
              <el-tablr-column prop="subunitQuantity" align="center" label="数量" />
              <el-table-column prop="subunitUnit" align="center" label="单位" />
            </el-table-column>
            <el-table-column align="center" label="主单位">
              <el-table-column prop="MainUnitUnit" align="center" label="单位" />
              <el-table-column prop="MainUnitShortage" align="center" label="短缺" />
              <el-table-column prop="MainUnitMissedDetection" align="center" label="漏检" />
              <el-table-column prop="MainUnitProcessingPrice" align="center" label="加工价" />
              <el-table-column prop="MainUnitProcessingTaxPrice" align="center" label="加工含税价" />
              <el-table-column prop="MainUnitProcessingAmount" align="center" label="加工金额" />
            </el-table-column>
            <el-table-column align="center" label="副单位">
              <el-table-column prop="SubUnitProcessingPrice" align="center" label="加工价" />
              <el-table-column prop="SubUnitProcessingTaxPrice" align="center" label="加工含税价" />
              <el-table-column prop="SubUnitProcessingAmount" align="center" label="加工金额" />
            </el-table-column>
            <el-table-column prop="taxRate" align="center" label="加工税率%" />
            <el-table-column prop="taxAmount" align="center" label="加工税额" />
            <el-table-column prop="totalAmount" align="center" label="加工价税合计" />
            <el-table-column prop="remark" align="center" label="备注" />
            <el-table-column prop="deficitQuantity" align="center" label="欠数" />
            <el-table-column prop="shift" align="center" label="班次" />
            <el-table-column prop="wight" align="center" label="单重" />
            <el-table-column prop="taskQuantity" align="center" label="任务数量" />
            <el-table-column align="center" label="操作" fixed="right">
              <template slot-scope="scope">
                <el-button type="text" size="mini" @click="handleDeleteHalfOfPi(scope.row)">删除</el-button>
                <el-button type="text" size="mini" @click="handleUpdateHalfOfPi(scope.row)">修改</el-button>
              </template>
            </el-table-column>
          </el-table>
          <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
            :total="total" />
        </div>

      </el-tab-pane>

      <el-tab-pane label="成品入库单" name="fourth">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
          label-width="68px">
          <el-form-item label="入库日期">
            <el-date-picker type="daterange" v-model="queryParams.date" range-separator="至" start-placeholder="开始日期"
          end-placeholder="结束日期" clearable style="width: 240px" />
          </el-form-item>
          <el-form-item label="入库人">
            <el-input v-model="queryParams.operator" placeholder="请输入入库人"></el-input>
          </el-form-item>
          <el-form-item label="仓库员">
            <el-input v-model="queryParams.staff" placeholder="请输入仓库员"></el-input>
          </el-form-item>
          <el-form-item label="币种">
            <el-select v-model="queryParams.currency" @change="hand" placeholder="请选择币种">
              <el-option label="人民币" value="1"></el-option>
              <el-option label="美元" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="汇率">
            <el-input v-model="queryParams.rate" placeholder="请输入产品代号"></el-input>
          </el-form-item>
          <el-form-item>
            <el-radio v-model="queryParams.radio" label="1">是否超单</el-radio>
            <el-radio v-model="queryParams.radio" label="2">是否已特批</el-radio>
          </el-form-item>
          <el-form-item label="部门">
            <el-select v-model="queryParams.department" placeholder="请选择部门"></el-select>
          </el-form-item>
          <el-form-item label="入库仓库">
            <el-select v-model="queryParams.warehouse" placeholder="请选择入库仓库">
              <el-option label="全部" value=""></el-option>
              <el-option label="仓库1" value="1"></el-option>
              <el-option label="仓库2" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="对应单号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入对应单号"></el-input>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="queryParams.remark" placeholder="请输入备注"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>

        <el-tooltip placement="top">
          <div slot="content">点击任意一行列即可查看详细入库信息</div>
          <el-table :data="purchaseList" @row-click="handleRowClick">
            <el-table-column align="center" label="入库日期" prop="date" />
            <el-table-column align="center" label="入库人" prop="operator" />
            <el-table-column align="center" label="仓库员" prop="staff" />
            <el-table-column align="center" label="币种" prop="currency" />
            <el-table-column align="center" label="汇率" prop="rate" />
            <el-table-column align="center" label="是否超单" prop="radio" />
            <el-table-column align="center" label="部门" prop="department" />
            <el-table-column align="center" label="入库仓库" prop="warehouse" />
            <el-table-column align="center" label="对应单号" prop="orderNo" />
            <el-table-column align="center" label="备注" prop="remark" />
          </el-table>
        </el-tooltip>

        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />

        <div v-if="showCard">
          <h2 align="center">{{ }}成品入库单</h2>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddProduct">新增</el-button>
            </el-col>
          </el-row>

          <el-table :data="PurchaseDate">
            <el-table-column align="center" label="产品描述">
              <el-table-column align="center" label="代号" prop="code"/>
              <el-table-column align="center" label="名称" prop="name"/>
              <el-table-column align="center" label="规格" prop="spec"/>
              <el-table-column align="center" label="浮动比例%" prop="floatingRatio"/>
            </el-table-column>
            <el-table-column align="center" label="装箱数" prop="package"/>
            <el-table-column align="center" label="颜色" prop="color"/>
            <el-table-column align="center" label="属性" prop="attribute"/>
            <el-table-column align="center" label="合同号" prop="contractNo"/>
            <el-table-column align="center" label="批号" prop="batchNo"/>
            <el-table-column align="center" label="仓库" prop="warehouse"/>
            <el-table-column align="center" label="当前库存" prop="currentInventory"/>
            <el-table-column align="center" label="主单位">
              <el-table-column align="center" label="单位" prop="MainUnitUnit"/>
              <el-table-column align="center" label="数量" prop="Mainnumber"/>
              <el-table-column align="center" label="单价" prop="unitPrice"/>
              <el-table-column align="center" label="含税价" prop="taxPrice" />
            </el-table-column>
          </el-table>
        </div>

      </el-tab-pane>

      <el-tab-pane label="销售退货入库单" name="fifth">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
          label-width="68px">
          <el-form-item label="退货日期">
            <el-date-picker type="daterange" v-model="queryParams.date" range-separator="至" start-placeholder="开始日期"
          end-placeholder="结束日期" clearable style="width: 240px" />
          </el-form-item>
          <el-form-item label="退货人">
            <el-input v-model="queryParams.operator" placeholder="请输入入库人"></el-input>
          </el-form-item>
          <el-form-item label="仓库员">
            <el-input v-model="queryParams.staff" placeholder="请输入仓库员"></el-input>
          </el-form-item>
          <el-form-item label="订单编号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入订单编号"></el-input>
          </el-form-item>
          <el-form-item label="币种">
            <el-select v-model="queryParams.currency" @change="hand" placeholder="请选择币种">
              <el-option label="人民币" value="1"></el-option>
              <el-option label="美元" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="汇率">
            <el-input v-model="queryParams.rate" placeholder="请输入产品代号"></el-input>
          </el-form-item>
          <el-form-item>
            <el-radio v-model="queryParams.radio" label="1">是否超单</el-radio>
            <el-radio v-model="queryParams.radio" label="2">是否已特批</el-radio>
          </el-form-item>
          <el-form-item label="发货客户">
            <el-select v-model="queryParams.department" placeholder="请选择发货客户"></el-select>
          </el-form-item>
          <el-form-item label="开票客户">
            <el-input v-model="queryParams.warehouse" placeholder="请输入开票客户"></el-input>
          </el-form-item>
          <el-form-item label="对应单号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入对应单号"></el-input>
          </el-form-item>
          <el-form-item label="退入仓库">
            <el-select v-model="queryParams.warehouse" placeholder="请选择退入仓库">
              <el-option label="全部" value=""></el-option>
              <el-option label="仓库1" value="1"></el-option>
              <el-option label="仓库2" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="queryParams.remark" placeholder="请输入备注"></el-input>
          </el-form-item>
          <el-form-item>
            <el-checkbox border v-model="checked">含税</el-checkbox>
          </el-form-item>
          <el-form-item label="产品代号">
            <el-input v-model="queryParams.productCode" placeholder="请输入产品代号"></el-input>
          </el-form-item>
          <el-form-item label="产品名称">
            <el-input v-model="queryParams.productName" placeholder="请输入产品名称"></el-input>
          </el-form-item>
          <el-form-item label="产品规格">
            <el-input v-model="queryParams.productSpec" placeholder="请输入产品规格"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>

        <el-tooltip placement="top">
          <div slot="content">点击任意一行列即可查看详细入库信息</div>
          <el-table :data="purchaseList" @row-click="handleRowClick">
            <el-table-column align="center" label="退货日期" prop="date" />
            <el-table-column align="center" label="退货人" prop="operator" />
            <el-table-column align="center" label="仓库员" prop="staff" />
            <el-table-column align="center" label="币种" prop="currency" />
            <el-table-column align="center" label="汇率" prop="rate" />
            <el-table-column align="center" label="是否超单" prop="radio" />
            <el-table-column align="center" label="发货客户" prop="department" />
            <el-table-column align="center" label="开票客户" prop="warehouse" />
            <el-table-column align="center" label="对应单号" prop="orderNo" />
            <el-table-column align="center" label="退入仓库" prop="warehouse" />
            <el-table-column align="center" label="备注" prop="remark" />
          </el-table>
        </el-tooltip>

        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />

        <div v-if="showCard">
          <h2 align="center">{{ }}销售退货入库单</h2>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini"
                @click="handleAddSaleReturn">新增</el-button>
            </el-col>
          </el-row>

          <el-table :data="SaleReturn">
            <el-table-column align="center" label="产品描述">
              <el-table-column align="center" label="代号" prop="code"/>
              <el-table-column align="center" label="名称" prop="name"/>
              <el-table-column align="center" label="规格" prop="spec"/>
            </el-table-column>
            <el-table-column align="center" label="装箱数" prop="amount"/>
            <el-table-column align="center" label="颜色" prop="color"/>
            <el-table-column align="center" label="属性" prop="attribute"/>
            <el-table-column align="center" label="合同号" prop="contractNo"/>
            <el-table-column align="center" label="批号" prop="batchNo"/>
            <el-table-column align="center" label="仓库" prop="warehouse"/>
            <el-table-column align="center" label="当前库存" prop="currentInventory"/>
            <el-table-column align="center" label="当前副单位库存" prop="currentSubUnitInventory"/>
            <el-table-column align="center" label="主单位">
              <el-table-column align="center" label="单位" prop="MainUnitUnit"/>
              <el-table-column align="center" label="数量" prop="Mainnumber"/>
              <el-table-column align="center" label="单价" prop="unitPrice"/>
              <el-table-column align="center" label="含税价" prop="taxPrice"/>
              <el-table-column align="center" label="金额" prop="amount"/>
            </el-table-column>
          </el-table>
        </div>

      </el-tab-pane>

      <el-tab-pane label="废品入库单" name="sixth">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
          label-width="68px">
          <el-form-item label="单据日期">
           <el-date-picker type="daterange" v-model="queryParams.date" range-separator="至" start-placeholder="开始日期"
          end-placeholder="结束日期" clearable style="width: 240px" />
          </el-form-item>
          <el-form-item label="仓库员">
            <el-input v-model="queryParams.staff" placeholder="请输入仓库员"></el-input>
          </el-form-item>
          <el-form-item label="入库人">
            <el-input v-model="queryParams.operator" placeholder="请输入入库人"></el-input>
          </el-form-item>
          <el-form-item label="币种">
            <el-select v-model="queryParams.currency" @change="hand" placeholder="请选择币种">
              <el-option label="人民币" value="1"></el-option>
              <el-option label="美元" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="汇率">
            <el-input v-model="queryParams.rate" placeholder="请输入产品代号"></el-input>
          </el-form-item>
          <el-form-item>
            <el-radio v-model="queryParams.radio" label="1">是否超单</el-radio>
            <el-radio v-model="queryParams.radio" label="2">是否已特批</el-radio>
          </el-form-item>
          <el-form-item label="部门">
            <el-select v-model="queryParams.department" placeholder="请选择部门"></el-select>
          </el-form-item>
          <el-form-item label="对应单号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入对应单号"></el-input>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="queryParams.remark" placeholder="请输入备注"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>

        <el-tooltip placement="top">
          <div slot="content">点击任意一行列即可查看详细入库信息</div>
          <el-table :data="purchaseList" @row-click="handleRowClick">
            <el-table-column align="center" label="单据日期" prop="date" />
            <el-table-column align="center" label="仓库员" prop="staff" />
            <el-table-column align="center" label="入库人" prop="operator" />
            <el-table-column align="center" label="币种" prop="currency" />
            <el-table-column align="center" label="汇率" prop="rate" />
            <el-table-column align="center" label="是否超单" prop="radio" />
            <el-table-column align="center" label="部门" prop="department" />
            <el-table-column align="center" label="对应单号" prop="orderNo" />
            <el-table-column align="center" label="备注" prop="remark" />
          </el-table>
        </el-tooltip>

        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />

        <div v-if="showCard">
          <h2 align="center">{{ }}废品入库单</h2>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddScrap">新增</el-button>
            </el-col>
          </el-row>
          <el-table :data="PurchaseDate">
            <el-table-column align="center" label="物品描述">
              <el-table-column align="center" label="代号" prop="code"/>
              <el-table-column align="center" label="名称" prop="name"/>
              <el-table-column align="center" label="规格" prop="spec"/>
            </el-table-column>
            <el-table-column align="center" label="颜色" prop="color"/>
            <el-table-column align="center" label="工序" prop="process"/>
            <el-table-column align="center" label="属性" prop="attribute"/>
            <el-table-column align="center" label="合同号" prop="contractNo"/>
            <el-table-column align="center" label="仓库" prop="warehouse"/>
            <el-table-column align="center" label="当前库存" prop="currentInventory"/>
            <el-table-column align="center" label="主单位">
              <el-table-column align="center" label="单位" prop="unit"/>
              <el-table-column align="center" label="数量" prop="Mainnumber"/>
              <el-table-column align="center" label="单价" prop="unitPrice"/>
              <el-table-column align="center" label="含税价" prop="taxPrice"/>
              <el-table-column align="center" label="金额" prop="amount"/>
            </el-table-column>
            <el-table-column align="center" label="副单位">
              <el-table-column align="center" label="单位" prop="subunitUnit"/>
              <el-table-column align="center" label="数量" prop="number"/>
              <el-table-column align="center" label="单价" prop="price"/>
              <el-table-column align="center" label="金额" prop="amount1"/>
            </el-table-column>
            <el-table-column align="center" label="税率%" prop="taxRate"/>
            <el-table-column align="center" label="税额" prop="taxAmount"/>
            <el-table-column align="center" label="价税合计" prop="totalAmount"/>
            <el-table-column align="center" label="附加单据号" prop="currency"/>
          </el-table>
        </div>
      </el-tab-pane>

      <el-tab-pane label="采购超订单入库单" name="seventh">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
          label-width="68px">
          <el-form-item label="入库日期">
           <el-date-picker type="daterange" v-model="queryParams.date" range-separator="至" start-placeholder="开始日期"
          end-placeholder="结束日期" clearable style="width: 240px" />
          </el-form-item>
          <el-form-item label="仓库员">
            <el-input v-model="queryParams.staff" placeholder="请输入仓库员"></el-input>
          </el-form-item>
          <el-form-item label="入库人">
            <el-input v-model="queryParams.operator" placeholder="请输入入库人"></el-input>
          </el-form-item>
          <el-form-item label="币种">
            <el-select v-model="queryParams.currency" @change="hand" placeholder="请选择币种">
              <el-option label="人民币" value="1"></el-option>
              <el-option label="美元" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="汇率">
            <el-input v-model="queryParams.rate" placeholder="请输入产品代号"></el-input>
          </el-form-item>
          <el-form-item>
            <el-radio v-model="queryParams.radio" label="1">是否超单</el-radio>
            <el-radio v-model="queryParams.radio" label="2">是否已特批</el-radio>
          </el-form-item>
          <el-form-item label="供应商">
            <el-select v-model="queryParams.department" placeholder="请选择供应商"></el-select>
          </el-form-item>
          <el-form-item label="对应单号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入对应单号"></el-input>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="queryParams.remark" placeholder="请输入备注"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>

        <el-tooltip placement="top">
          <div slot="content">点击任意一行列即可查看详细入库信息</div>
          <el-table :data="purchaseList" @row-click="handleRowClick">
            <el-table-column align="center" label="入库日期" prop="date" />
            <el-table-column align="center" label="仓库员" prop="staff" />
            <el-table-column align="center" label="入库人" prop="operator" />
            <el-table-column align="center" label="币种" prop="currency" />
            <el-table-column align="center" label="汇率" prop="rate" />
            <el-table-column align="center" label="是否超单" prop="radio" />
            <el-table-column align="center" label="供应商" prop="supplier" />
            <el-table-column align="center" label="对应单号" prop="orderNo" />
            <el-table-column align="center" label="备注" prop="remark" />
          </el-table>
        </el-tooltip>

        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />

        <div v-if="showCard">
          <h2 align="center">{{ }}采购超订单入库单</h2>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPurchase">新增</el-button>
            </el-col>
          </el-row>
          <el-table :data="PurchaseDate">
            <el-table-column align="center" label="物品描述">
              <el-table-column align="center" label="代号" prop="code"/>
              <el-table-column align="center" label="名称" prop="name"/>
              <el-table-column align="center" label="规格" prop="spec"/>
              <el-table-column align="center" label="类型" prop="type"/>
              <el-table-column align="center" label="条形码" prop="barcode"/>
              <el-table-column align="center" label="转换率" prop="conversionRate"/>
            </el-table-column>
            <el-table-column align="center" label="颜色" prop="color"/>
            <el-table-column align="center" label="属性" prop="attribute"/>
            <el-table-column align="center" label="合同号" prop="contractNo"/>
            <el-table-column align="center" label="批号" prop="batchNo"/>
            <el-table-column align="center" label="仓库" prop="warehouse"/>
            <el-table-column align="center" label="当前库存" prop="currentInventory"/>
            <el-table-column align="center" label="当前副单位库存" prop="currentSubUnitInventory"/>
            <el-table-column align="center" label="主单位">
              <el-table-column align="center" label="单位" prop="MainUnitUnit"/>
              <el-table-column align="center" label="数量" prop="Mainnumber"/>
            </el-table-column>
            <el-table-column align="center" label="副单位">
              <el-table-column align="center" label="单位" prop="subunitUnit"/>
              <el-table-column align="center" label="数量" prop="subunitQuantity"/>
            </el-table-column>
            <el-table-column align="center" label="附加单据号" prop="currency"/>
            <el-table-column align="center" label="备注" prop=""/>
            <el-table-column align="center" label="参照数量" prop="referenceQuantity"/>
            <el-table-column align="center" label="对应验收单">
              <el-table-column align="center" label="单号" prop="1"/>
            </el-table-column>
            <el-table-column align="center" label="对应收货单">
              <el-table-column align="center" label="单号" prop="2"/>
            </el-table-column>
            <el-table-column align="center" label="对应采购">
              <el-table-column align="center" label="单号" prop="3"/>
            </el-table-column>
          </el-table>
        </div>
      </el-tab-pane>

      <el-tab-pane label="其他入库单" name="eighth">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
          label-width="68px">
          <el-form-item label="单据日期">
           <el-date-picker type="daterange" v-model="queryParams.date" range-separator="至" start-placeholder="开始日期"
          end-placeholder="结束日期" clearable style="width: 240px" />
          </el-form-item>
          <el-form-item label="仓库员">
            <el-input v-model="queryParams.staff" placeholder="请输入仓库员"></el-input>
          </el-form-item>
          <el-form-item label="入库人">
            <el-input v-model="queryParams.operator" placeholder="请输入入库人"></el-input>
          </el-form-item>
          <el-form-item label="币种">
            <el-select v-model="queryParams.currency" @change="hand" placeholder="请选择币种">
              <el-option label="人民币" value="1"></el-option>
              <el-option label="美元" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="汇率">
            <el-input v-model="queryParams.rate" placeholder="请输入产品代号"></el-input>
          </el-form-item>
          <el-form-item>
            <el-radio v-model="queryParams.radio" label="1">是否超单</el-radio>
            <el-radio v-model="queryParams.radio" label="2">是否已特批</el-radio>
          </el-form-item>
          <el-form-item label="部门">
            <el-select v-model="queryParams.department" placeholder="请选择部门"></el-select>
          </el-form-item>
          <el-form-item label="对应单号">
            <el-input v-model="queryParams.orderNo" placeholder="请输入对应单号"></el-input>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="queryParams.remark" placeholder="请输入备注"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>

        </el-form>

        <el-tooltip placement="top">
          <div slot="content">点击任意一行列即可查看详细入库信息</div>
          <el-table :data="purchaseList" @row-click="handleRowClick">
            <el-table-column align="center" label="单据日期" prop="date" />
            <el-table-column align="center" label="仓库员" prop="staff" />
            <el-table-column align="center" label="入库人" prop="operator" />
            <el-table-column align="center" label="币种" prop="currency" />
            <el-table-column align="center" label="汇率" prop="rate" />
            <el-table-column align="center" label="是否超单" prop="radio" />
            <el-table-column align="center" label="部门" prop="department" />
            <el-table-column align="center" label="对应单号" prop="orderNo" />
            <el-table-column align="center" label="备注" prop="remark" />
          </el-table>
        </el-tooltip>

        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />

        <div v-if="showCard">
          <h2 align="center">{{ }}其他入库单</h2>
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddOther">新增</el-button>
            </el-col>
          </el-row>

          <el-table :data="Other">
            <el-table-column align="center" label="物品描述">
              <el-table-column align="center" label="代号" prop="code"/>
              <el-table-column align="center" label="名称" prop="name"/>
              <el-table-column align="center" label="规格" prop="spec"/>
            </el-table-column>
            <el-table-column align="center" label="装箱数" prop="package"/>
            <el-table-column align="center" label="颜色" prop="color"/>
            <el-table-column align="center" label="工序" prop="process"/>
            <el-table-column align="center" label="属性" prop="attribute"/>
            <el-table-column align="center" label="合同号" prop="contractNo"/>
            <el-table-column align="center" label="仓库" prop="warehouse"/>
            <el-table-column align="center" label="当前库存" prop="currentInventory"/>
            <el-table-column align="center" label="当前副单位库存" prop="currentSubUnitInventory"/>
            <el-table-column align="center" label="主单位">
              <el-table-column align="center" label="单位" prop="MainUnitUnit"/>
              <el-table-column align="center" label="数量" prop="Mainnumber"/>
              <el-table-column align="center" label="单价" prop="unit"/>
              <el-table-column align="center" label="含税价" prop="taxPrice"/>
              <el-table-column align="center" label="金额" prop="amount"/>
            </el-table-column>
          </el-table>
        </div>

        <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
          :total="total" />
      </el-tab-pane>
    </el-tabs>

    <!-- 采购入库单 -->
    <el-dialog :title="titlePurchase" :visible.sync="openPurchase" width="800px" append-to-body>
      <el-form :model="formPurchase" ref="formPurchase" :rules="rulesPurchase" label-width="80px">
        <el-row>
          <el-col :span="8">
            <el-form-item label="代号" prop="code">
              <el-input v-model="formPurchase.code" placeholder="请输入代号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="名称" prop="name">
              <el-input v-model="formPurchase.name" placeholder="请输入名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="规格" prop="spec">
              <el-input v-model="formPurchase.spec" placeholder="请输入规格"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="浮动比例%" prop="floatingRatio">
              <el-input v-model="formPurchase.floatingRatio" placeholder="请输入浮动比例"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="类型" prop="type">
              <el-select v-model="formPurchase.type" placeholder="请选择类型">
                <el-option label="原材料" value="原材料"></el-option>
                <el-option label="辅料" value="辅料"></el-option>
                <el-option label="半成品" value="半成品"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="类别名称" prop="cotegoryName">
              <el-input v-model="formPurchase.cotegoryName" placeholder="请输入类别名称"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="16">
            <el-form-item label="条形码" prop="barcode">
              <el-input v-model="formPurchase.barcode" placeholder="请输入条形码"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="转换率" prop="conversionRate">
              <el-input v-model="formPurchase.conversionRate" placeholder="请输入转换率"></el-input>
            </el-form-item>
          </el-col>

        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="颜色" prop="color">
              <el-input v-model="formPurchase.color" placeholder="请输入颜色"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="属性" prop="attribute">
              <el-input v-model="formPurchase.attribute" placeholder="请输入属性"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="合同号" prop="contractNo">
              <el-input v-model="formPurchase.contractNo" placeholder="请输入合同号"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="批号" prop="batchNo">
              <el-input v-model="formPurchase.batchNo" placeholder="请输入批号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="货位" prop="storageLocation">
              <el-input v-model="formPurchase.storageLocation" placeholder="请输入货位"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="仓库" prop="warehouse">
              <el-input v-model="formPurchase.warehouse" placeholder="请输入仓库"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="当前库存" prop="currentInventory">
              <el-input v-model="formPurchase.currentInventory" placeholder="请输入当前库存"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitformPurchase">提交</el-button>
        <el-button @click="cancelPurchase">取消</el-button>
      </div>

    </el-dialog>

    <!-- 生产退料单 -->
    <el-dialog :title="titleProductionDate" :visible.sync="openProductionDate" width="800px" append-to-body>
      <el-form :model="formProductionDate" ref="formProductionDate" :rules="rulesProductionDate" label-width="80px">

        <!-- <el-divider><h3>物料描述</h3></el-divider> -->

        <el-row>
          <el-col :span="8">
            <el-form-item label="代号" prop="code">
              <el-input v-model="formProductionDate.code" placeholder="请输入代号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="名称" prop="name">
              <el-input v-model="formProductionDate.name" placeholder="请输入名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="规格" prop="spec">
              <el-input v-model="formProductionDate.spec" placeholder="请输入规格"></el-input>
            </el-form-item>
          </el-col>

        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="转换率" prop="conversionRate">
              <el-input v-model="formProductionDate.conversionRate" placeholder="请输入转换率"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="颜色" prop="color">
              <el-input v-model="formProductionDate.color" placeholder="请输入颜色"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="属性" prop="attribute">
              <el-input v-model="formProductionDate.attribute" placeholder="请输入属性"></el-input>
            </el-form-item>
          </el-col>

        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="合同号" prop="contractNo">
              <el-input v-model="formProductionDate.contractNo" placeholder="请输入合同号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="批号" prop="batchNo">
              <el-input v-model="formProductionDate.batchNo" placeholder="请输入批号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="仓库" prop="warehouse">
              <el-select v-model="formProductionDate.warehouse" placeholder="请选择仓库">
                <el-option label="原料仓库" value="1"></el-option>
                <el-option label="加工厂" value="2"></el-option>
                <el-option label="成品仓库" value="3"></el-option>
              </el-select>
            </el-form-item>
          </el-col>

        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="当前库存" prop="currentInventory">
              <el-input v-model="formProductionDate.currentInventory" placeholder="请输入当前库存"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单位(主单位)" prop="unit">
              <el-select v-model="formProductionDate.unit" placeholder="请选择单位">
                <el-option label="件" value="1"></el-option>
                <el-option label="张" value="2"></el-option>
                <el-option label="立方米" value="3"></el-option>
                <el-option label="吨" value="4"></el-option>
                <el-option label="个" value="5"></el-option>
                <el-option label="公斤" value="6"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="良品(主单位)" prop="goodProduct">
              <el-input v-model="formProductionDate.goodProduct" placeholder="请输入良品"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="单价(主单位)" prop="unitPrice">
              <el-input v-model="formProductionDate.unitPrice" placeholder="请输入单价"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="含税价(主单位)" prop="taxPrice">
              <el-input v-model="formProductionDate.taxPrice" placeholder="请输入含税价"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="金额(主单位)" prop="amount">
              <el-input v-model="formProductionDate.amount" placeholder="请输入金额"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="不良品" prop="badProduct">
              <el-input v-model="form.badProduct" placeholder="请输入不良品"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单位(副单位)" prop="unit1">
              <el-select v-model="form.unit1" placeholder="请选择单位">
                <el-option label="件" value="1"></el-option>
                <el-option label="张" value="2"></el-option>
                <el-option label="立方米" value="3"></el-option>
                <el-option label="吨" value="4"></el-option>
                <el-option label="个" value="5"></el-option>
                <el-option label="公斤" value="6"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="数量(副单位)" prop="quantity1">
              <el-input v-model="form.quantity1" placeholder="请输入数量"></el-input>
            </el-form-item>
          </el-col>

        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="单价(副单位)" prop="unitPrice1">
              <el-input v-model="form.unitPrice1" placeholder="请输入单价"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="金额(副单位)" prop="amount1">
              <el-input v-model="form.amount1" placeholder="请输入金额"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="税率%" prop="taxRate">
              <el-input v-model="form.taxRate" placeholder="请输入税率"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="税额" prop="taxAmount">
              <el-input v-model="form.taxAmount" placeholder="请输入税额"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="价税合计" prop="totalPrice">
              <el-input v-model="form.totalPrice" placeholder="请输入价税合计"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="附件单据号" prop="attachmentBillNo">
              <el-input v-model="form.attachmentBillNo" placeholder="请输入附件单据号"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitformProductionDate">提交</el-button>
        <el-button @click="cancelProductionDate">取消</el-button>
      </div>
    </el-dialog>

    <!-- 半成品入库单 -->
    <el-dialog :title="titleHalfFinished" :visible.sync="openHalfFinished" width="800px" append-to-body>
      <el-form :model="formHalfFinished" ref="formHalfFinished" :rules="rulesHalfFinished" label-width="80px">

        <el-row>
          <el-col :span="8">
            <el-form-item label="仓库" prop="warehouse">
              <el-input v-model="formHalfFinished.warehouse" placeholder="请输入仓库"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="合同号" prop="contractNumber">
              <el-input v-model="formHalfFinished.contractNumber" placeholder="请输入合同号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-itme label="代号" prop="productCode">
              <el-input v-model="formHalfFinished.productCode" placeholder="请输入代号"></el-input>
            </el-form-itme>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="名称" prop="productName">
              <el-input v-model="formHalfFinished.productName" placeholder="请输入名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="颜色" prop="color">
              <el-input v-model="formHalfFinished.color" placeholder="请输入颜色"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="参照数量" prop="referenceQuantity">
              <el-input v-model="formHalfFinished.referenceQuantity" placeholder="请输入参照数量"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="实际入库数量(主单位)" prop="actualQuantity">
              <el-input v-model="formHalfFinished.actualQuantity" placeholder="请输入实际入库数量"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工号(员工)" prop="staff">
              <el-input v-model="formHalfFinished.staff" placeholder="请输入工号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="姓名(员工)" prop="staffName">
              <el-input v-model="formHalfFinished.staffName" placeholder="请输入姓名"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="当前副单位库存" prop="currentSubUnitInventory"></el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="当前库存" prop="currentInventory">
              <el-input v-model="formHalfFinished.currentInventory" placeholder="请输入当前库存"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="单位(主单位)" prop="MainUnitUnit"></el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>


  </div>
</template>

<script>

export default {
  data() {
    return {
      //生产退料单
    productionList:[
      {
        date:'2024-10-11',
        staff:'王五',
        operator:'入库人甲',
        currency:'人民币',
        warehouse:'这是个仓库',
        orderNo:'dy-1234587',
        remark:'',
        productCode:'1'
      },
      {
        date:'2024-10-11',
        staff:'王五',
        operator:'入库人甲',
        currency:'人民币',
        warehouse:'这是个仓库',
        orderNo:'dy-1234587',
        remark:'',
        productCode:'1'
      },
      {
        date:'2024-10-11',
        staff:'王五',
        operator:'入库人甲',
        currency:'人民币',
        warehouse:'这是个仓库',
        orderNo:'dy-1234587',
        remark:'',
        productCode:'1'
      }
    ],
    

      //其他入库
      List:[
        {
          date:'2024-10-11',
          staff:'王五',
          operator:'入库人甲',
          currency:'人民币',
          rate:'1',
          radio:'否',
          department:'仓库管理部门',
          orderNo:'we-1234859403',
          remark:''
        }
      ],
      //销售入库单
      SaleList:[
      {
        date:'2023-10-3',
        operator:'刘上',
        staff:'仓库员乙',
        currency:'日元',
        rate:'22',
        radio:'是',
        department:'仓库管理部门',
        warehouse:'仓库A',
        orderNo:'日',
        warehouse:'',
        remark:''
      }
      ],
       purchaseList: [ 
      {
        date: '2024-11-12',
        staff:'张三',
        operator:'李四',
        supplier:'供货商2',
        warehouse:'九江办仓库',
        orderNo:'hy-28084230',
        remark:'',
        productCode:'这是产品代号',
        productName:'这是产品名称',
        productSpec:'这是产品规格'
      }
    ],
      // 采购入库单
      titlePurchase:'',
      openPurchase: false,
      formPurchase: {},
      rulesPurchase: {},
      purchaseList:[{
        date:'2019-03-01',
        staff:'张颜颜',
        operator:'李芳芳',
        supplier:'田洋',
        warehouse:'余姚市舜吉塑化有限公司',
        orderNo:'#2739423422',
        remark:'',
        productCode:'A1-40137',
        productName:'余姚A1-40137',
        productSpec:'A1-40137',
        currency:'人民币',
        rate:'1',
        radio:'否',
        department:'运隆',
      },
    {
        date:'2019-03-01',
        staff:'陈庆',
        operator:'宋伟',
        supplier:'吴天',
        warehouse:'无锡宏发茶花家居用品有限公司',
        orderNo:'#2428995592',
        remark:'',
        productCode:'A1-24059',
        productName:'无锡A1-24059',
        productSpec:'A1-24059',
        currency:'人民币',
        rate:'1',
        radio:'否',
        department:'运隆',
      }],
      PurchaseDate:[{
        code: 'A1-40137',
        name: '花纸',
        spec: '10*10*10', 
        attribute: '优良',
        contractNo: '130405',
        batchNo: '24KG/包',
        storageLocation: '自购',
        warehouse: '余姚市舜吉塑化有限公司',
        currentInventory: '3000',
        unit: '克(g)',
        goodProduct: '800000g',
        unitPrice: '1.8元',  
        taxPrice: '4元',
        floatingRatio:'5%',
        type:'油亮',
        cotegoryName:'油亮花纸',
        barcode:'295239523923',
        conversionRate:'45%',
        color:'淡黄色',
        referenceQuantity:'100000',
        actualQuantity:'20000',
        staff:'9t85239412',
        staffName:'陈庆',
        currentSubUnitInventory:'14000',
        subunitQuantity:'24000',
        subunitUnit:'斤',
        MainUnitUnit:'克',
        Mainnumber:'30000',
        MainUnitShortage:'2000',
        MainUnitMissedDetection:'500',
        MainUnitProcessingPrice:'40000',
        MainUnitProcessingAmount:'45000',
        
        MainUnitProcessingTaxPrice:'45000',
        SubUnitProcessingPrice:'34000',
        SubUnitProcessingTaxPrice:'36000',
        SubUnitProcessingAmount:'40000',
        taxRate:'13%',
        taxAmount:'40000',
        totalAmount:'45000',
        deficitQuantity:'30000',
        package:'3000',
        shift:'18',
        wight:'12',
        taskQuantity:'3000',
        process:'染色处理',
        currency:'28974234210',
        amount:'21000',
        number:'1200',
        price:'2.1',
        amount1:'3210',
        1:'#Y947249712',
        2:'#Y421098797',
        3:'#Z027427291',
            }],
      
      // 生产退料单
      titleProductionDate:'',
      openProductionDate: false,
      formProductionDate: {},
      rulesProductionDate: {},
      ProductionDate:[{
        code: 'A1-40137',
        name: '花纸',
        spec: '10*10*10', 
        attribute: '优良',
        contractNo: '130405',
        batchNo: '24KG/包',
        storageLocation: '自购',
        warehouse: '余姚市舜吉塑化有限公司',
        currentInventory: '3000',
        unit: '克(g)',
        goodProduct: '800000g',
        unitPrice: '1.8元',  
        taxPrice: '4元',
        floatingRatio:'5%',
        type:'油亮',
        cotegoryName:'油亮花纸',
        barcode:'295239523923',
        conversionRate:'45%',
        color:'淡黄色',
        amount:'0.5',
        badProduct:'50',
        unit1:'斤',
        number:'4900',
        price1:'50',
        amount1:'30000',
        taxRate:'13%',
        taxAmount1:'34000',
        totalAmount:'4000',
        currency:'NXDD1905150001',

      }],
      
      // 半成品入库单
      titleHalfFinished:'',
      openHalfFinished: false,
      formHalfFinished: {},
      rulesHalfFinished: {},
      HalfOfPi: [
  {
    warehouse: '密胺半成品仓库',
    contractNumber: '250305',
    productCode: 'MB-YL080430',
    productName: '大圆桌面',
    color: '5903#',
    referenceQuantity: '475',
    actualQuantity: '131',
    staff: '',
    staffName: '',
    currentInventory: '0',
    MainUnitUnit: '0',
    subunitQuantity: '131',
    subunitUnit: '个'
  },
  {
    warehouse: '密胺半成品仓库',
    contractNumber: '250306',
    productCode: 'MB-YL0807235',
    productName: '23.5"托盘',
    color: '素面白色',
    referenceQuantity: '918',
    actualQuantity: '88',
    staff: '',
    staffName: '',
    currentInventory: '582',
    MainUnitUnit: '582',
    subunitQuantity: '88',
    subunitUnit: '个'
  },
  {
    warehouse: '密胺半成品仓库',
    contractNumber: '250306',
    productCode: 'MB-YL080727',
    productName: '27"托盘',
    color: '素面白色',
    referenceQuantity: '900',
    actualQuantity: '173',
    staff: '',
    staffName: '',
    currentInventory: '0',
    MainUnitUnit: '0',
    subunitQuantity: '173',
    subunitUnit: '个'
  }],
  // 成品入库单
      titleHalfFinished:'',
      openHalfFinished: false,
      formHalfFinished: {},
      rulesHalfFinished: {},
      Product: [
      {
        productCode: 'YL796136',
        productName: '13.6寸长方盘35*23*2.5CM',
        spec: '',
        floatingRatio: '',
        packingNumber: '12',
        color: '',
        attribute: '',
        contractNo: '230501',
        batchNo: 'A1-02720',
        warehouse: '成品仓库',
        currentInventory: '0',
        quantity: '4800',
        unitPrice: '0',
        taxPrice: '0',
        subunitQuantity: '400',
        subunitUnitPrice: '0',
        subunitTaxPrice: '0'
      },
      {
        productCode: 'YL014615',
        productName: '长方提手托盘38*28*4.3cm',
        spec: '',
        floatingRatio: '',
        packingNumber: '24',
        color: '',
        attribute: '',
        contractNo: '230501',
        batchNo: 'A1027199',
        warehouse: '成品仓库',
        currentInventory: '0',
        quantity: '3600',
        unitPrice: '0',
        taxPrice: '0',
        subunitQuantity: '150',
        subunitUnitPrice: '0',
        subunitTaxPrice: '0'
      }],
    // 销售退货入库单
      titleHalfFinished:'',
      openHalfFinished: false,
      formHalfFinished: {},
      rulesHalfFinished: {},
      SaleReturnList:[
      {
        productCode: 'YL2016',
        productName: '手柄水杯',
        spec: 'YL69204',
        packingNumber: '96',
        color: 'A5单色',
        attribute: '',
        contractNo: '',
        batchNo: '',
        warehouse: '成品废品库',
        currentInventory: '5',
        currentSubunitInventory: '0.05',
        unit: '个',
        quantity: '2',
        unitPrice: '4.23',
        taxPrice: '4.23',
        amount: '8.46',
        subunitUnit: '箱',
        subunitQuantity: '0.0208',
        subunitUnitPrice: '1.7308',
        subunitAmount: '8.46',
        taxRate: '0',
        taxAmount: '0',
        totalAmount: '8.46'
      },
      {
        productCode: 'YL2009',
        productName: '4.7"双耳童碗',
        spec: 'YL444047',
        packingNumber: '96',
        color: 'A5单色',
        attribute: '',
        contractNo: '',
        batchNo: '',
        warehouse: '成品废品库',
        currentInventory: '1160',
        currentSubunitInventory: '12.08',
        unit: '个',
        quantity: '1',
        unitPrice: '4.05',
        taxPrice: '4.05',
        amount: '4.05',
        subunitUnit: '箱',
        subunitQuantity: '0.0104',
        subunitUnitPrice: '1.4231',
        subunitAmount: '4.05',
        taxRate: '0',
        taxAmount: '0',
        totalAmount: '4.05'
      }],
      // 其它入库单
      titleHalfFinished:'',
      openHalfFinished: false,
      formHalfFinished: {},
      rulesHalfFinished: {},
      OtherList:[
        {
          code:'YL587072',
          name:'7.2寸长柄勺',
          spec:'18*4*2.2',
          packingQuantity:'360',
          color:'',
          process:'',
          attribute:'熊出没',
          contractNumber:'',
          warehouse:'北京办',
          currentStock:'288',
          currentSubUnitInventory:'0.8',
          unit:'只',
          quantity:'720',
          unitPrice:'1.55',
          taxIncludedPrice:'',
          amount:'1116',
          subUnit:'箱',
          subUnitQuantity:'720',
          subUnitPrice:'1.55',
          subUnitAmount:'1116',
          cess:'',
          tax:''
        },
        {
          code:'YL587072',
          name:'7.2寸长柄勺',
          spec:'18*4*2.2',
          packingQuantity:'360',
          color:'',
          process:'',
          attribute:'熊出没',
          contractNumber:'',
          warehouse:'北京办',
          currentStock:'288',
          currentSubUnitInventory:'0.8',
          unit:'只',
          quantity:'720',
          unitPrice:'1.55',
          taxIncludedPrice:'',
          amount:'1116',
          subUnit:'箱',
          subUnitQuantity:'720',
          subUnitPrice:'1.55',
          subUnitAmount:'1116',
          cess:'',
          tax:''
        },
        {
          code:'YL587072',
          name:'7.2寸长柄勺',
          spec:'18*4*2.2',
          packingQuantity:'360',
          color:'',
          process:'',
          attribute:'熊出没',
          contractNumber:'',
          warehouse:'北京办',
          currentStock:'288',
          currentSubUnitInventory:'0.8',
          unit:'只',
          quantity:'720',
          unitPrice:'1.55',
          taxIncludedPrice:'',
          amount:'1116',
          subUnit:'箱',
          subUnitQuantity:'720',
          subUnitPrice:'1.55',
          subUnitAmount:'1116',
          cess:'',
          tax:''
        }
      ],
      //半成品入库
      HalfOfPiList:[
        {
          date:'2023-4-25',
          operator:'入库人丙',
          staff:'仓库员甲',
          currency:'人民币',
          rate:'1',
          radio:'否',
          department:'这是个部门',
          warehouse:'',
          orderNo:'',
          remark:''
        }
      ],
      //成品入库单
      ProductList:[
        {
          date:'2024-3-6',
          operator:'入库人甲',
          staff:'仓库员乙',
          currency:'美元',
          rate:'7',
          radio:'否',
          department:'这是一个部门',
          warehouse:'入库仓库A',
          orderNo:'dh-1048948',
          remark:''
        },
        {
          date:'2024-3-6',
          operator:'入库人甲',
          staff:'仓库员乙',
          currency:'美元',
          rate:'7',
          radio:'否',
          department:'这是一个部门',
          warehouse:'入库仓库A',
          orderNo:'dh-1048948',
          remark:''
        },{
          date:'2024-3-6',
          operator:'入库人甲',
          staff:'仓库员乙',
          currency:'美元',
          rate:'7',
          radio:'否',
          department:'这是一个部门',
          warehouse:'入库仓库A',
          orderNo:'dh-1048948',
          remark:''
        }

      ],
      //采购超订单入库单
       Purchase: [
        {
        code: 'hy-yl0788',
        name: 'hy-yl0788花纸',
        spec: '',
        type: 'yl-0788',
        barcode: '',
        conversionRate: '80%',
        color: '#9656',
        attribute: '',
        contractNumber: 'ht-651642',
        batchNumber: 'ph-23615',
        warehouse: '仓库1',
        currentStock: '仓库2',
        currentSubUnitStock: 'currentSubUnitStock',
        mainUnit: '个',
        mainUnitQuantity: 'mainUnitQuantity',
        subUnit: '1566',
        subUnitQuantity: '',
        additionalDocumentNumber: 'ji-55154',
        remark: 'remark',
        referenceQuantity: '',
        inspectionOrderNumber: 'inspectionOrderNumber',
        receiptOrderNumber: 'receiptOrderNumber',
        purchaseOrderNumber: ''
        }
       ],
       //采购超定单
       PurchaseList:[
         {
        date: '2019-12-1',
        staff: '仓库员乙',
        operator: '入库人乙',
        currency: '美元',
        rate: '7',
        radio: '否',
        department: '这是一个部门',
        orderNo: 'dh-1234432',
        remark: 'remark'
      }, 
      {
         date: '2019-12-1',
        staff: '仓库员乙',
        operator: '入库人乙',
        currency: '美元',
        rate: '7',
        radio: '否',
        department: '这是一个部门',
        orderNo: 'dh-1234432',
        remark: 'remark'
      },
      {
         date: '2019-12-1',
        staff: '仓库员乙',
        operator: '入库人乙',
        currency: '美元',
        rate: '7',
        radio: '否',
        department: '这是一个部门',
        orderNo: 'dh-1234432',
        remark: 'remark'
      }
       ],
       
        Scrap: [
          {
        code: 'hz-7088',          // 物品代号
        name: 'ht-510花纸',          // 物品名称
        spec: '',          // 规格
        color: '#2615',        // 颜色
        process: '',    // 工序
        attribute: 'attribute',// 属性
        contractNumber: 'hj-653000', // 合同号
        warehouse: '仓库A',// 仓库
        currentStock: '仓库2', // 当前库存
        // 主单位相关字段
        mainUnit: '个',          // 若为嵌套结构，可写为 'mainUnit.unit'
        mainUnitQuantity: '100',
        mainUnitPrice: '23',
        mainUnitTaxIncludedPrice: '25',
        mainUnitAmount: '1200',
        // 副单位相关字段
        subUnit: '个',
        subUnitQuantity: '140',
        subUnitPrice: '23',
        subUnitAmount: '1367',
        // 财务相关字段
        taxRate: '10%',        // 税率
        taxAmount: '12',    // 税额
        totalAmount: '29',// 价税合计
        additionalDocumentNumber: '6511651651' // 附加单据号
      },
          {
        code: 'hz-7088',          // 物品代号
        name: 'ht-510花纸',          // 物品名称
        spec: '',          // 规格
        color: '#2615',        // 颜色
        process: '',    // 工序
        attribute: 'attribute',// 属性
        contractNumber: 'hj-653000', // 合同号
        warehouse: '仓库A',// 仓库
        currentStock: '仓库2', // 当前库存
        // 主单位相关字段
        mainUnit: '个',          // 若为嵌套结构，可写为 'mainUnit.unit'
        mainUnitQuantity: '100',
        mainUnitPrice: '23',
        mainUnitTaxIncludedPrice: '25',
        mainUnitAmount: '1200',
        // 副单位相关字段
        subUnit: '个',
        subUnitQuantity: '140',
        subUnitPrice: '23',
        subUnitAmount: '1367',
        // 财务相关字段
        taxRate: '10%',        // 税率
        taxAmount: '12',    // 税额
        totalAmount: '29',// 价税合计
        additionalDocumentNumber: '6511651651' // 附加单据号
      }
      
       ], 
       ScrapList:[
        {
          date: '2018-9-11',
          staff: '仓库员甲',
          operator: '入库员甲',
          currency: '美元',
          rate: '7',
          radio: '否',
          department: '这是一个部门',
          orderNo: 'dh123456',
          remark: ''
        },
        {
           date: '2018-9-11',
          staff: '仓库员甲',
          operator: '入库员甲',
          currency: '美元',
          rate: '7',
          radio: '否',
          department: '这是一个部门',
          orderNo: 'dh123456',
          remark: ''
        },
        {
           date: '2018-9-11',
          staff: '仓库员甲',
          operator: '入库员甲',
          currency: '美元',
          rate: '7',
          radio: '否',
          department: '这是一个部门',
          orderNo: 'dh123456',
          remark: ''
        }
       ],
            
          
        
       
      // 加载动画
      loading: false,
      
      radio: 1,
      checked: 1,
      activeName: 'first',
      showCard: true,
      showSearch: true,
      queryParams: {
        date: ''
      },
      SaleReturn: [
        {
        code: 'A1-40137',
        name: '花纸',
        spec: '10*10*10', 
        attribute: '优良',
        contractNo: '130405',
        batchNo: '24KG/包',
        storageLocation: '自购',
        warehouse: '余姚市舜吉塑化有限公司',
        currentInventory: '3000',
        unit: '克(g)',
        goodProduct: '800000g',
        unitPrice: '1.8元',  
        taxPrice: '4元',
        floatingRatio:'5%',
        type:'油亮',
        cotegoryName:'油亮花纸',
        barcode:'295239523923',
        conversionRate:'45%',
        color:'淡黄色',
        amount:'3000',
        currentSubUnitInventory:'14000',
          MainUnitUnit:'克',
        Mainnumber:'30000',
      }
      ],
      Other: [
         {
        code: 'A1-40137',
        name: '花纸',
        spec: '10*10*10', 
        attribute: '优良',
        contractNo: '130405',
        batchNo: '24KG/包',
        storageLocation: '自购',
        warehouse: '余姚市舜吉塑化有限公司',
        currentInventory: '3000',
        unit: '克(g)',
        goodProduct: '800000g',
        unitPrice: '1.8元',  
        taxPrice: '4元',
        floatingRatio:'5%',
        type:'油亮',
        cotegoryName:'油亮花纸',
        barcode:'295239523923',
        conversionRate:'45%',
        color:'淡黄色',
        process:'涂覆处理',
        package:'2300',
        currentSubUnitInventory:'3000',
        MainUnitUnit:'克',
        Mainnumber:'30000',
        amount:'21000',
      }
      ],
      form: {
        staff: '',
        date: '',
        accountant: '',
        modifier: '',
        createDate: '',
        auditDate: '',
        auditor: '',
        auditInfo: '',
        auditLevel: ''
      },
      total: 0,
    }
  },
  methods: {
    
    
    
    hand() {
      this.queryParams.rate = (this.queryParams.currency == 1) ? 1 : 7;
    },
    // 新增采购入库单
    handleAddPurchase(){
      this.resetPurchase();
      this.openPurchase = true;
      this.titlePurchase = '新增采购入库单';
    },
    // 修改采购入库单
    handleUpdatePurchase(row){
      this.openPurchase = true;
      this.titlePurchase = '修改采购入库单';
      this.formPurchase = row;
    },
    // 删除采购入库单
    handleDeletePurchase(row){
      this.$confirm('确认删除该采购入库单吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.PurchaseDate.splice(this.PurchaseDate.indexOf(row), 1);
        this.$message({
          type:'success',
          message: '删除成功!'
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        })
      })
    },
    // 取消采购入库单
    cancelPurchase(){
      this.resetPurchase();
      this.openPurchase = false;
    },
    // 提交采购入库单
    submitformPurchase() {
      this.$refs['formPurchase'].validate((valid) => {
        if(valid){
          this.loading = true;
          if(this.titlePurchase == '新增采购入库单'){
          setTimeout(() => {
            this.loading = false;
            this.PurchaseDate.push(this.formPurchase)
            this.$message({
              type:'success',
              message: '采购入库单添加成功!'
            })
          },1000)
          console.log(this.PurchaseDate);
          
          this.openPurchase = false;
          } else if(this.titlePurchase == '修改采购入库单'){
            setTimeout(() => {
              this.PurchaseDate.map((item, index) => {
                if(item.code == this.formPurchase.code){
                  this.PurchaseDate[index] = this.formPurchase;
                }
              })
              this.loading = false;
              this.$message({
                type:'success',
                message: '采购入库单修改成功!'
                })
            }, 1000);
            this.openPurchase = false;
          }
        }
      })
    },
    // 重置采购入库单
    resetPurchase(){
      this.formPurchase = {
      };
    },
    // 新增生产退料单
    handleAddProduction(){
      this.resetProductionDate();
      this.openProductionDate = true;
      this.titleProductionDate = '新增生产退料单';
    },
    // 修改生产退料单
    handleUpdateProduction(row){
      this.openProductionDate = true;
      this.titleProductionDate = '修改生产退料单';
      this.formProductionDate = row;
    },
    // 删除生产退料单
    handleDeleteProduction(row){
      this.$confirm('确认删除该生产退料单吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.ProductionDate.splice(this.ProductionDate.indexOf(row), 1);
        this.$message({
          type:'success',
          message: '删除成功!'
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        })
      })
    },
    // 提交生产退料单
    submitformProductionDate() {
      this.$refs['formProductionDate'].validate((valid) => {
        if(valid){
          this.loading = true;
          if(this.titleProductionDate == '新增生产退料单'){
            setTimeout(() => {
              this.loading = false;
              this.ProductionDate.push(this.formProductionDate)
              this.$message({
                type:'success',
                message: '生产退料单添加成功!'
              })
            },1000)
            this.openProductionDate = false;
          } else if(this.titleProductionDate == '修改生产退料单'){
            setTimeout(() => {
              this.ProductionDate.map((item, index) => {
                if(item.code == this.formProductionDate.code){
                  this.ProductionDate[index] = this.formProductionDate;
                }
              })
              this.loading = false;
              this.$message({
                type:'success',
                message: '生产退料单修改成功!'
              })
            }, 1000);
            this.openProductionDate = false;
          }
          
        }
      })
    },
    // 取消生产退料单
    cancelProductionDate(){
      this.openProductionDate = false;
      this.resetProductionDate();
    },
    // 重置生产退料单
    resetProductionDate(){
      this.formProductionDate = {
      };
    }
  }
}
</script>
